<?php
/*
 * Created on Oct 30, 2013
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>


<style type="text/css">
<!--
    div.page {
        border: 1px solid #ddd9e9; 
    }
    
    div#my_playing_game {
        color : #bd5741;
    }
    div#my_playing_game > div {
        text-align: center;
    }
    div#my_playing_game > div div.border {
        text-align: center;
        border: 1px solid #ddd9e9; 
        border-radius: 10px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
        margin-left: 20%;
        width: 60%;
        padding: 10px 10px 15px;
    }
    div#my_playing_game > h3.title{
        margin-left: 2%;
    }
    
    div#my_playing_game p.first{
        color: #0a4874;
        font-weight: bold;
        margin-top: 0px;
    }
    div#my_playing_game span.point{
        color: #f26732;
    }
    
    div#backToPage {
        cursor: pointer;
        margin-left: 2%;
        padding-top: 5px;
    }
	div.game {
        padding: 5px;
        text-align: center;
        width: 100%;
        
    }
    
    div.game h3.name {
        color: #4c0000;
        text-align: left;
        padding-bottom: 5px;
        border-bottom: 1px dashed #d5d5d5;
    }
    div.game img
    {
        width: 150px;
        height: 150px;
    }
       
    div.game > div.div_image{
        width: 200px;
    }
    div.game > div.div_info{
        text-align: left;
        width: 70%;
    }
    div.game > div.div_info span{
        color: #244d6b;
        font-weight: bold;
    }
    
  div.game > div.div_info p{
        margin-top: 0px;
        margin-bottom: 8px;
    }
    div.game > div.div_info table {
        width: 100%;
        color: #244d6b;
        font-weight: bold;
    }
    div.game > div.div_info table td {
        padding: 5px;
    }
     div.game > div.div_info table td.error {
        color: red;
        font-weight: normal;
        text-align: center;
        border-radius: 10px;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
        background-color: #D4D4D4;
    }
    div.game > div.div_info table .value_normal {
        color: black;
        font-weight: normal;
    }
    div.game > div.div_info table .value {
        color: black;
        font-weight: bold;
    }
    div.history {
        padding: 10px;
    }
    div.history > p.title{
        color: #525252;
    }
    table.history {
        width: 100%;
        border: 1px solid #a5b4b7;
        font-weight: normal !important;
    }
    table.history th{
        background-color: #a5b4b7;
        padding: 5px;
        color: white;
        height: 33px;
    }
    table.history td{
        padding: 5px;
        text-align: center;
        height: 33px;
    }
    /*so chan */
    table.history tr.even
    {
        
    }
    /*so le*/
    table.history tr.odd{   
        background-color: #84E4EA;
    }
    
-->
</style>

<div class="page">
    
    <div id="my_playing_game">
        <h3 class="title">.::. My Money &amp; Points</h3>
        <div>
            <div class="border">
                <p class="first">Your current points balance</p>
                <span class="point"><strong><?=(int)$player_acc_detail->point_balance?></strong> points</span>
                <a href="/pay/moneyExchange" class="button">Buy more points</a>
            </div>
        </div>
    </div>
    <div class="history">
        <p class="title">Your Money &amp; Points History ( <?=$countRowHistory?> rows ): </p>
        <table class="history">
            <thead>
                <tr>
                    <th style="width: 4%;"></th>
                    <th style="width: 18%;">Date</th>
                    <th style="width: 50%;">Note</th>
                    <th style="width: 10%;">Money</th>
                    <th >Points</th>
                </tr>
            </thead>
            <?php if (isset($player_payment_history) && count($player_payment_history) > 0): ?>
            <?php
                $i= $startRecord;
                foreach($player_payment_history as $history){
            ?>
                <tr class="<?=($i%2 ==0)?'even':'odd'?>" >
                    <td><?=++$i?></td>
                    <td><?=$history->paydate?></td>
                    <td><?=$history->description?></td>
                    <td><?php 
                    if (($history->amount) != 0)
                        echo "$".round($history->amount,2);
                    ?></td>
                    <td><?=$history->paytype?><?=(int)$history->point?> points </td>
                </tr>
            <?php
                }
            ?>
            <?php else: ?>
            <tr>
                <td colspan="5">No records</td>
            </tr>
            <?php endif; ?>
        </table>
        
        <div class="paging">
            <?php
                for ($inPage = 1; $inPage<=Round($countPage); $inPage++)
                {
                    if ($inPage == $ipage)
                        echo "<a href='#$inPage' class='here'>$inPage</a>";
                    else
                        echo "<a href='javascript:money_point_history($inPage)'>$inPage</a>";
                }
            ?>
        </div>    
    </div>                
    <div style="clear: both;"></div>
</div>


<script type="text/javascript">
<!--
	function money_point_history(page)
    {
        $.get( '/pay/money_point_history/' + page, function( content ) {
            $('#Content').html(content);
        });
    }
-->
</script>